<?php
drupal_add_css('css/ui-lightness/jquery-ui-1.8.16.custom.css');
drupal_add_js('js/jquery-ui-1.8.16.custom.min.js');
?>
<script type="text/javascript">
	$(function(){
		var dates = $( "#from, #to" ).datepicker({	        
	        changeMonth: true,
	        numberOfMonths: 3,        
	        onSelect: function( selectedDate ) {
	            var option = this.id == "from" ? "minDate" : "maxDate",
	            instance = $( this ).data( "datepicker" ),
	            date = $.datepicker.parseDate(
	                instance.settings.dateFormat ||
	                $.datepicker._defaults.dateFormat,
	                selectedDate, instance.settings );
	            dates.not( this ).datepicker( "option", option, date );
	        }
	    });
	});
</script>
<form name="gallery_filter" id="gallery_filter" action="" method="get">
	<label for="page">Ở trang:</label>
	<select id="page" name="page">
         <option value="">-- Chọn trang hiển thị --</option>
         <?php
            $positions = unserialize(GALLERY_PAGES);
            if (!empty($positions)) {
                foreach ($positions as $key => $title) {
                    echo '<option value="' . $key . '" ' . ($_GET['page'] == $key ? 'selected="selected"' : '') . '>' . $title . '</option>';
                }
            }
        ?>         
	</select>
	
	<label for="start_end">Thời gian:</label>
	Bắt đầu: <input value="<?php echo $_GET['from'] ?>" type="text" size="15" id="from" name="from" readonly="readonly" />
	Kết thúc: <input value="<?php echo $_GET['to'] ?>" type="text" size="15" id="to" name="to" readonly="readonly" />	
	<input type="submit" value="Lọc">
	<input type="button" value="Xóa trắng" onclick="window.location='<?php echo base_path() . 'back-end/gallery' ?>';">
</form>
<?php
echo l ( 'Thêm mới gallery', 'back-end/gallery/add' );
echo $data ['listGallery'];
?>